package com.xuchaotong.processor;

import com.xuchaotong.service.LifeCycleService;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

public class MyBeanProcessor implements BeanPostProcessor{
    @Override
    public Object postProcessBeforeInitialization(Object o, String s) throws BeansException {
//        LifeCycleService service = (LifeCycleService)o;
//        service.cycle();
        System.out.println("BeanPostProcessor before....");
        return o;
    }

    @Override
    public Object postProcessAfterInitialization(Object o, String s) throws BeansException {
        System.out.println("BeanPostProcessor after...");
        return o;
    }
}
